﻿#if USE_UNI_LUA
using LuaAPI = UniLua.Lua;
using RealStatePtr = UniLua.ILuaState;
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
#else
using LuaAPI = XLua.LuaDLL.Lua;
using RealStatePtr = System.IntPtr;
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
#endif

using XLua;
using System.Collections.Generic;


namespace XLua.CSObjectWrap
{
    using Utils = XLua.Utils;
    public class UnityEngineU2DSpriteShapeRendererWrap 
    {
        public static void __Register(RealStatePtr L)
        {
			ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			System.Type type = typeof(UnityEngine.U2D.SpriteShapeRenderer);
			Utils.BeginObjectRegister(type, L, translator, 0, 4, 2, 2);
			
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "Prepare", _m_Prepare);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetBounds", _m_GetBounds);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetSegments", _m_GetSegments);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetChannels", _m_GetChannels);
			
			
			Utils.RegisterFunc(L, Utils.GETTER_IDX, "color", _g_get_color);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "maskInteraction", _g_get_maskInteraction);
            
			Utils.RegisterFunc(L, Utils.SETTER_IDX, "color", _s_set_color);
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "maskInteraction", _s_set_maskInteraction);
            
			
			Utils.EndObjectRegister(type, L, translator, null, null,
			    null, null, null);

		    Utils.BeginClassRegister(type, L, __CreateInstance, 1, 0, 0);
			
			
            
			
			
			
			Utils.EndClassRegister(type, L, translator);
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstance(RealStatePtr L)
        {
            
			try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
				if(LuaAPI.lua_gettop(L) == 1)
				{
					
					var gen_ret = new UnityEngine.U2D.SpriteShapeRenderer();
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				
			}
			catch(System.Exception gen_e) {
				return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
			}
            return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.U2D.SpriteShapeRenderer constructor!");
            
        }
        
		
        
		
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_Prepare(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                UnityEngine.U2D.SpriteShapeRenderer gen_to_be_invoked = (UnityEngine.U2D.SpriteShapeRenderer)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    Unity.Jobs.JobHandle _handle;translator.Get(L, 2, out _handle);
                    UnityEngine.U2D.SpriteShapeParameters _shapeParams;translator.Get(L, 3, out _shapeParams);
                    UnityEngine.Sprite[] _sprites = (UnityEngine.Sprite[])translator.GetObject(L, 4, typeof(UnityEngine.Sprite[]));
                    
                    gen_to_be_invoked.Prepare( _handle, _shapeParams, _sprites );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetBounds(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                UnityEngine.U2D.SpriteShapeRenderer gen_to_be_invoked = (UnityEngine.U2D.SpriteShapeRenderer)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    
                        var gen_ret = gen_to_be_invoked.GetBounds(  );
                        translator.Push(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetSegments(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                UnityEngine.U2D.SpriteShapeRenderer gen_to_be_invoked = (UnityEngine.U2D.SpriteShapeRenderer)translator.FastGetCSObj(L, 1);
            
            
                
                {
                    int _dataSize = LuaAPI.xlua_tointeger(L, 2);
                    
                        var gen_ret = gen_to_be_invoked.GetSegments( _dataSize );
                        translator.Push(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetChannels(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
                UnityEngine.U2D.SpriteShapeRenderer gen_to_be_invoked = (UnityEngine.U2D.SpriteShapeRenderer)translator.FastGetCSObj(L, 1);
            
            
			    int gen_param_count = LuaAPI.lua_gettop(L);
            
                if(gen_param_count == 2&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) 
                {
                    int _dataSize = LuaAPI.xlua_tointeger(L, 2);
                    Unity.Collections.NativeArray<ushort> _indices;
                    Unity.Collections.NativeSlice<UnityEngine.Vector3> _vertices;
                    Unity.Collections.NativeSlice<UnityEngine.Vector2> _texcoords;
                    
                    gen_to_be_invoked.GetChannels( _dataSize, out _indices, out _vertices, out _texcoords );
                    translator.Push(L, _indices);
                        
                    translator.Push(L, _vertices);
                        
                    translator.Push(L, _texcoords);
                        
                    
                    
                    
                    return 3;
                }
                if(gen_param_count == 2&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) 
                {
                    int _dataSize = LuaAPI.xlua_tointeger(L, 2);
                    Unity.Collections.NativeArray<ushort> _indices;
                    Unity.Collections.NativeSlice<UnityEngine.Vector3> _vertices;
                    Unity.Collections.NativeSlice<UnityEngine.Vector2> _texcoords;
                    Unity.Collections.NativeSlice<UnityEngine.Vector4> _tangents;
                    
                    gen_to_be_invoked.GetChannels( _dataSize, out _indices, out _vertices, out _texcoords, out _tangents );
                    translator.Push(L, _indices);
                        
                    translator.Push(L, _vertices);
                        
                    translator.Push(L, _texcoords);
                        
                    translator.Push(L, _tangents);
                        
                    
                    
                    
                    return 4;
                }
                if(gen_param_count == 2&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) 
                {
                    int _dataSize = LuaAPI.xlua_tointeger(L, 2);
                    Unity.Collections.NativeArray<ushort> _indices;
                    Unity.Collections.NativeSlice<UnityEngine.Vector3> _vertices;
                    Unity.Collections.NativeSlice<UnityEngine.Vector2> _texcoords;
                    Unity.Collections.NativeSlice<UnityEngine.Vector4> _tangents;
                    Unity.Collections.NativeSlice<UnityEngine.Vector3> _normals;
                    
                    gen_to_be_invoked.GetChannels( _dataSize, out _indices, out _vertices, out _texcoords, out _tangents, out _normals );
                    translator.Push(L, _indices);
                        
                    translator.Push(L, _vertices);
                        
                    translator.Push(L, _texcoords);
                        
                    translator.Push(L, _tangents);
                        
                    translator.Push(L, _normals);
                        
                    
                    
                    
                    return 5;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            
            return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.U2D.SpriteShapeRenderer.GetChannels!");
            
        }
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_color(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.U2D.SpriteShapeRenderer gen_to_be_invoked = (UnityEngine.U2D.SpriteShapeRenderer)translator.FastGetCSObj(L, 1);
                translator.PushUnityEngineColor(L, gen_to_be_invoked.color);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_maskInteraction(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.U2D.SpriteShapeRenderer gen_to_be_invoked = (UnityEngine.U2D.SpriteShapeRenderer)translator.FastGetCSObj(L, 1);
                translator.PushUnityEngineSpriteMaskInteraction(L, gen_to_be_invoked.maskInteraction);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_color(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.U2D.SpriteShapeRenderer gen_to_be_invoked = (UnityEngine.U2D.SpriteShapeRenderer)translator.FastGetCSObj(L, 1);
                UnityEngine.Color gen_value;translator.Get(L, 2, out gen_value);
				gen_to_be_invoked.color = gen_value;
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 0;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_maskInteraction(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                UnityEngine.U2D.SpriteShapeRenderer gen_to_be_invoked = (UnityEngine.U2D.SpriteShapeRenderer)translator.FastGetCSObj(L, 1);
                UnityEngine.SpriteMaskInteraction gen_value;translator.Get(L, 2, out gen_value);
				gen_to_be_invoked.maskInteraction = gen_value;
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 0;
        }
        
		
		
		
		
    }
}
